package com.gzc.pm.util
{
	import cn.skyclass.net.URLUtilEx;

	public class ParamParser
	{
		public function ParamParser(parameters:Object)
		{
			_parammeters = parameters;
			init();
		}
		
		private var _parammeters:Object;
		
		public var userId:String;//用户ID
		public var urlPrefix:String;//资源加载地址前缀 
		public var contextPath:String;//RO工程contextPath
		
		/**预警/质量分析模块参数**/
		public var plId:int;//生产线
		
		/**轮轴转产模块参数**/
		public var cplModuleType:int;//转产模块类型
		public static const CPL_MODULE_MANAGER:int = 0;//编辑
		public static const CPL_MODULE_SHOW:int = 1;//展示
		
		private function init():void{
			userId = _parammeters.userId ? _parammeters.userId : 'sys';
			urlPrefix = _parammeters.urlPrefix ? _parammeters.urlPrefix : '';
			contextPath = _parammeters.contextPath ? _parammeters.contextPath : URLUtilEx.getContextPath();
			
			/**预警/质量分析模块参数**/
			plId = _parammeters.plId ? _parammeters.plId : 0;
			
			/**轮轴转产模块参数**/
			cplModuleType = (_parammeters.cplModuleType && 
				(_parammeters.cplModuleType==CPL_MODULE_MANAGER || _parammeters.cplModuleType==CPL_MODULE_SHOW))
				? _parammeters.cplModuleType : CPL_MODULE_MANAGER;
		}
		
	}
}